package com.dxf;

import com.dxf.service.Exam;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {


        ApplicationContext context = new ClassPathXmlApplicationContext("spring-ioc.xml");





        //DoSomeThing doSomeThing2 =(DoSomeThing)context.getBean("doSomeThing");
        //DoSomeThing doSomeThing =context.getBean("doSomeThing",DoSomeThing.class);

        //System.out.println(doSomeThing==doSomeThing2);
       /* doSomeThing.eat();
        doSomeThing.drink("饮料");*/

        //Student student = (Student)context.getBean("studentFactory");
       /* Student dystu = (Student)context.getBean("dystu");
        System.out.println(dystu);*/


       Exam exam = context.getBean("exam", Exam.class);

        //context.getB
       // Exam exam2 = context.getBean("exam", Exam.class);
       // System.out.println(exam2==exam);
        exam.handle();

        //System.in.read();


    }
}
